package com.miage.bean;

import java.util.ArrayList;
import java.util.List;

public class Evenement {
	
	private Integer id;
	private String nom;
	private String dateDebut;
	private String dateFin;
	
	private transient List<Depense> listDepenses;
	private transient List<Participant> listParticipants;
	
	public Evenement(Integer id, String nom, String dateDebut, String dateFin) {
		super();
		this.id = id;
		this.nom = nom;
		this.dateDebut = dateDebut;
		this.dateFin = dateFin;
		this.listDepenses = new ArrayList<Depense>();
		this.listParticipants = new ArrayList<Participant>();
	}
	


	public Evenement(Integer id, String nom, String dateDebut, String dateFin, List<Participant> listParticipants) 
	
	{
		super();
		this.id = id;
		this.nom = nom;
		this.dateDebut = dateDebut;
		this.dateFin = dateFin;
		this.listDepenses = new ArrayList<Depense>();
		this.listParticipants = new ArrayList<Participant>();
	}
	
	public Evenement(Integer id, String nom) {
		super();
		this.id = id;
		this.nom = nom;
		this.dateDebut = "01/01/2000";
		this.dateFin = "01/01/2000";
		this.listDepenses = new ArrayList<Depense>();
		this.listParticipants = new ArrayList<Participant>();
	}
	
	public Evenement() {
		super();
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getNom() {
		return nom;
	}

	public void setNom(String nom) {
		this.nom = nom;
	}

	public String getDateDebut() {
		return dateDebut;
	}

	public void setDateDebut(String dateDebut) {
		this.dateDebut = dateDebut;
	}

	public String getDateFin() {
		return dateFin;
	}

	public void setDateFin(String dateFin) {
		this.dateFin = dateFin;
	}
	
	public List<Depense> getListDepenses() {
		return listDepenses;
	}

	public List<Participant> getListParticipants() 
	{
		return listParticipants;
	}
	
	public void setListDepenses(List<Depense> listDepenses) {
		this.listDepenses = listDepenses;
	}
	
	public void setListParticipants(List<Participant> listParticipants) {
		this.listParticipants = listParticipants;
	}

	public float getMontantTotalEvenement() {
		float sum = 0.0f;
		for (Depense dep : listDepenses) {
			sum += dep.getMontant();
		}
		return sum;
	}
	
}
